<template>
    <div class="content-all">
        <!-- 商城列表 -->
        <div class="list">
            <div 
            v-for="(item,index) in topArr" 
            :key="index" 
            class="list-content" 
            @click="gotoListDetails(item)"
            >
                <div class="list-circular" >
                    <img :src=item.url alt="">
                </div>
                <div class="list-title">{{item.title}}</div>
            </div>
            
            
            
        </div>
        <!-- 商城优惠券广告位 -->
        <div class="advertising-coupon">
            <div class="advertising-left">
                <img src="../../../assets/images/swiper3.jpg" alt="">
            </div>
            <div class="advertising-right">
                <img src="../../../assets/images/swiper3.jpg" alt="">
            </div>
        </div>
    </div>
</template>

<script>


export default {
    name:'ShoppingList',
    data(){
        return{
            
        }
    },
    mounted(){
        
    },
    methods:{
        gotoListDetails(item){
            this.$router.push({
                name:'ListDetails',
                params:{
                    obj:item
                }
            })
        }
    },
    props:{
        topArr:{
            type:Array,
            default:[]
        }
    }

}
</script>

<style scoped>
.content-all{
    background-color: white;
}
.list{
    display: flex;
    flex-wrap: wrap;
    width: 100%;
    height: 212px;
    line-height: 20px;
    
}
.list-content{
    flex:0 0 25%;
    height: 106px;
    text-align: center;
}
.list-circular{
    width:45px;
    height: 45px;
    border-radius: 50%;
    margin: 0 auto;
    margin-top: 19px;
}
.list-circular img{
    width:100%;
    height: 100%;
    border-radius: 50%;
}
.list-title{
    width: 50px;
    height: 24px;
    font-size: 12px;
    line-height: 17px;
    color: rgba(16, 16, 16, 1);
    font-family: Arial;
    margin: 0 auto;
    margin-top: 10px;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
}
.advertising-coupon{
    width:100%;
    height: 97px;
    position: relative;
}
.advertising-left{
    width: 186px;
    height: 97px;
    line-height: 20px;
    background-color: rgba(247, 240, 247, 1);
    text-align: center;
    position: absolute;
    left: 0;
    top: 0;
}
.advertising-left img{
    width: 100%;
    height: 100%;
}
.advertising-right{
    width: 186px;
    height: 97px;
    line-height: 20px;
    background-color: rgba(247, 240, 247, 1);
    text-align: center;
    position: absolute;
    right: 0;
    top: 0;
}
.advertising-right img{
    width: 100%;
    height: 100%;
}
</style>
